home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap03 / TicTac / TicTac.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  900 b   |  42 lines

  1. //***********************************************************************
  2. //
  3. //  TicTac.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CMyApp : public CWinApp
  8. {
  9. public:
  10.     virtual BOOL InitInstance ();
  11. };
  12.  
  13. class CMainWindow : public CWnd
  14. {
  15. private:
  16.     static const CRect m_rcSquares[9];
  17.     int m_nGameGrid[9];
  18.     int m_nNextChar;
  19.  
  20.     int GetRectID (CPoint);
  21.     void DrawBoard (CDC*);
  22.     void DrawX (CDC*, int);
  23.     void DrawO (CDC*, int);
  24.     void ResetGame ();
  25.     void CheckForGameOver ();
  26.     int IsWinner ();
  27.     BOOL IsDraw ();
  28.  
  29. public:
  30.     CMainWindow ();
  31.  
  32. protected:
  33.     virtual void PostNcDestroy ();
  34.  
  35.     afx_msg void OnPaint ();
  36.     afx_msg void OnLButtonDown (UINT, CPoint);
  37.     afx_msg void OnLButtonDblClk (UINT, CPoint);
  38.     afx_msg void OnRButtonDown (UINT, CPoint);
  39.  
  40.     DECLARE_MESSAGE_MAP ()
  41. };
  42.